Index
Macro Commands Help File

Overview
.
Commands

   - Text & Keys
   - Time & Date
   - File
   - Directory
   - Internet
   - Networking
   - Window
   - Clipboard
   - System
   - Message
   - Mouse
   - Variables
   - Macro Flow Control
   - Text Formatting
   - Forms

   - Scripts  (Note:  Available only in “ToolsWorks Advanced Scripting” and “ToolsWorks Admin & Developer”)
.
System Variables


Overview

Macro is just a piece of text that can contain some commands.  If the macro doesn't contain any command then it is just inserted to the currently active application as a plain text.  It is the simplest case.  Such macros are usually frequently used pieces of text like phrases, your address, your e-mail etc.  If there is a command within the macro then it is automatically recognized and interpreted by the given way (all the other macro text that is not recognized as a command is just a text that is inserted into the active application).

Commands have its special syntax that makes it easier to recognize them within the whole macro text.  The command usually looks like this:
<some_command>("param1", param2, ...)
Parameter can be:

1.	Static text (constant number).

2.	Variable

3.	Combination of a static text and variables.  Variable used in a combination with static text must be enclosed in % chars (“a text %vVariable% text continues…).  For example, to create a file with name based on the current date you can use this: <filecreate>(“c:\myfiles\%_vCurrDate_Year%-%_vCurrDate_MM%-%_vCurrDate_DD%.doc”,0).  This will create c:\myfiles\2000-08-19.doc file.

There are also commands that have no parameters.  Such commands look like this:
<command_noparam>
Each command can be visually edited so that it is not necessary to know the command syntax.  There are 100+ commands designed to accomplish variety Windows automation tasks.  The commands cover these areas:  time & date, files, directories, internet, networking, windows, clipboard, macro flow control, text formatting and more.

Special keys (like 'Enter', 'Page Down', etc.) use the same syntax:
<enter>
<pgdn>

There is also a support for variables implemented.  There are three basic types of variables:

•	Local variables - user defines these variables using <varset> command.  The variable name can be any string and the variable is known only inside the macro it is defined.

•	Global variables - there are two types of global variables that differ by scope:
  - macro global variable - the variable is known in all the macros (called from each other using <run> command) during the macro execution.  The macro global variable must begin with the "gm_" prefix (for example, "gm_varName").
  - application global variable - the variable is known during the whole application session (the value is remembered until the program is closed).  The application global variable must begin with the "ga_" prefix (for example, "ga_varCurrentProject").

•	System variables - the variables provide system dependent information.  Cannot be changed by <varchng> command (are "read-only").

All the variables (except system variables) can be used also as an array without any special declaration.  For the array, this syntax is used:
varVariableName[index]
If a variable with the given index (for example, varName[10]) doesn't have a value assigned yet the default value is empty string.


Text & Keys

	Printable keys (characters), such as a-z, A-Z, 0-9, etc., can be typed into the macro directly.  There is not a special command or syntax for inserting text. For special keys see the table below: .
<back>	Back	<enter>	Enter (return)
<shift>	Shift	<ctrl>	Ctrl
<alt>	Alt	<capslock>	Caps Lock
<esc>	Escape	<pgup>	Page up
<pgdn>	Page down	<end>	End
<home>	Home	<left>	Left arrow key
<up>	Up arrow key	<down>	Down arrow key
<right>	Right arrow key	<insert>	Insert
<delete>	Delete	<tab>	Tab
<F1>-<F24>	F1 - F24 function keys	<break>	Break
<clear>	Clear	<select>	Select
<execkey>	Execute key	<lwinkey>	Left Windows key
<rwinkey>	Right Windows key	<appskey>	Application key
<scroll>	Scroll	<numlock>	Num Lock
<numpad0>  - <numpad9>	Numpad keys 0 - 9	<numpad+>	Numpad + key
<numpad*>	Numpad * key	<numpad->	Numpad - key
<numpad/>	Numpad / key	<printscreen>	Print Screen
Windows2000 Keys:
<browser_back>		<media_nexttrack>
<browser_forward>		<media_prevtrack>
<browser_refresh>		<media_stop>
<browser_stop>		<media_play_pause>
<browser_search>		<launch_mail>
<browser_favorites>		<launch_media_select>
<browser_home>		<launch_app1>
<volume_mute>		<launch_app2>
<volume_down>
<volume_up>


Time & Date

<time>	Insert time	<ct:m>	Insert minute
<date>	Insert date	<ct:mlz>	Insert minute (with leading zero)
<td:d>	Insert day	<ct:h24lz>	Insert hour (24 hours base, leading zero)
<td:dlz>	Insert day (with leading zero)	<ct:h12lz>	Insert hour (12 hours base, leading zero)
<td:m>	Insert month	<ct:ampm>	Insert "am/pm"
<td:mlz>	Insert month (with leading zero)	<ct:AMPM>	Insert "AM/PM"
<td:y>	Insert year
<ct:h24>	Insert hour (24 hours base)
<ct:h12>	Insert hour (12 hours base)


File

<execappex>	Start (execute) application	<filedel>	Delete file(s)
<fileopen>	Open file	<fileinfo>	Get file info (size, time, etc.)
<filecreate>	Create new file	<data_load>	Load text data from file
<filecopy>	Copy file(s)	<data_save>	Save text data to file
<filemove>	Move file(s)


Directory

<dircreate>	Create directory (folder)	<dirmove>	Move directory
<diropen>	Open directory	<dirdel>	Delete directory
<dircopy>	Copy directory


Internet

<wwwopen>	Open web page	<email>	Create e-mail
FTP
<ftp_getfile>	Download file from FTP server	<ftp_createdir>	Create new directory on FTP server
<ftp_putfile>	Upload file to FTP server	<ftp_deldir>	Delete directory on FTP server
<ftp_delfile>	Delete file
<ftp_renamefile>	Rename file on FTP server


Networking

<netcondrive>	Connect network drive	<netcondrivedlg>	Connect network drive dialog window
<netdiscondrive>	Disconnect network drive	<netdiscondrivedlg>	Disconnect network drive dialog window


Window

<actwin>	Activate window	<winstate>	Change window state
<winmove>	Move  window	<winclose>	Close window
<winresize>	Resize window
Desktop Windows
<winminall>	Minimize all windows (no parameters)	<wintile_v>	Tile windows vertically (no parameters)
<wintile_h>	Tile windows horizontally (no parameters)	<wincascade>	Cascade windows (no parameters)


Clipboard

<clpsave>	Save clipboard data to file	<clpempty>	Empty clipboard (no parameters)
<clpload>	Load clipboard data from file	<clpput>	Put text data to clipboard
<clppastetext>	Paste text


System

<findfilesdlg>	Find file dialog window (no parameters)	<scrsavestart>	Start default screen saver (no parameters)
<findcompdlg>	Find computer dialog window (no parameters)	<shutdown>	Shutdown computer
<rundlg>	Run dialog window (no parameters)	<setsystime>	Set system time
<contextmenu>	Show context menu (no parameters)	<setsysdate>	Set system date
<recbinempty>	Empty recycle bin (no parameters)	<beep>	Play sound
		<post_win_msg>	Post Windows Message (PostMessage API call)


Message

<msg>	Show a message window.	<msgoff>	Close message window (no parameters).  This command is used to close a message window with no OK button.


Mouse

<mm>	Move mouse cursor	<mousemove_relative_win>	Mouse move is relative to active window (no parameters).
<mousemove_absolute>	Mouse move is in absolute screen coordinates (no parameters).	<mousemove_relative_win>	Mouse move is relative to current mouse position (no parameters).
<mlbd>	Mouse left button down (no parameters)	<mmbu>	Mouse middle button up (no parameters)
<mlbu>	Mouse left button up (no parameters)	<mrbd>	Mouse right button down (no parameters)
<mmbd>	Mouse middle button down (no parameters)	<mrbu>	Mouse right button up (no parameters)


Variables

<varset>	Declare and set variable	<var_load>	Load variable value from file
<varchng>	Modify (change) variable value	<var_save>	Persist (save) variable to file
<varout>	Output (print) variable to destination application


Macro Flow Control

Calls
<run>	Run other macro (item)	<listbox>	Show selection list box window to choose from multiple macros
<extmacro>	Run macro from external file
If-Else
<if_str> <if_num>	Compare (string) variables Compare (numerical) variables	<if_clp>	If clipboard is empty
<if_win>	If window is opened, active, etc.	<else>	Starts opposite branch to <if...> branch.
<if_file>	If file exists, is bigger than, etc.	<endif>	Closes the IF section.  Each <if...> must be close by <endif>
<if_dir>	If directory exists
Go to
<goto>	Jump to a predefined   (by <label>) point in the macro	<label>	Point in the macro where it is possible to jump using <goto>
Loop
<begloop>	Begin loop	<endloop>	End loop (no parameters).  See <begloop>.
Wait/Pause
<pause>	Pause macro for users input	<waitfor>	Wait for special event to occur (window close, key press, etc.)
<wx>	Wait X milliseconds
Other
<faston>	Send keystrokes fast	<commands_only_on>	Consider only commands in macro
<fastoff>	Send keystrokes slow (see <faston>).	<commands_only_off>	Consider whole the macro text (see <commands_only_on)
<exitmacro>	Stop macro execution (no parameters).


Text Formatting

<text>	Format text


Forms

<form_item>	Define form item	<form_show>	Show form window


System Variables

Windows:
_vActiveWindow	Contains title of the currently active window
_vActiveWindowPrev	Contains title of the previously active window
_vWinFromMouseCur	Contains title of window the mouse is over
Macro Flow Control:
_vLoopCounter	Loop counter (see <begloop> and <endloop> commands).
.
Date & Time:
_vCurrDate_Day	Contains day of the current date (e.g., 9 if the date is 02/09/2000).
_vCurrDate_DD	Contains day of the current date in the DD format (e.g., 09)
_vCurrDate_Month	Contains month of the current date (e.g., 02 if the date is 02/19/2000).
_vCurrDate_MM	Contains month of the current date in the MM format (e.g., 02).
_vCurrDate_Year	Contains year of the current date (e.g., 2000 if the date is 02/19/2000).
_vCurrDate_YY	Contains year of the current date in the YY format (e.g., 00).
_vCurrDate_MonthName	Contains name of the month of the current date (e.g., February if the date is 02/19/2000).
_vCurrDate_DDMMYYYY	Contains current date in DD/MM/YYYY form.
_vCurrDate_MMDDYYYY	Contains current date in MM/DD/YYYY form.
_vCurrTime_Hour12	Contains hour of the current time (e.g., 2 if the current time is 2:15:00 PM).
_vCurrTime_Hour24	Contains hour of the current time (e.g., 14 if the current time is 2:15:00 PM).
_vCurrTime_Minute	Contains minute of the current time (e.g., 15 if the current time is 2:15:00 PM).
_vCurrTime_Second	Contains second of the current time (e.g., 0 if the current time is 2:15 PM).
_vCurrTime_AMPM	Contains PM/AM of the current time (e.g., PM if the current time is 2:15 PM).
_vCurrTime_Total	Contains the number of milliseconds elapsed from the last reboot.
.
Files & Folders:
_vFolder_AppData	Contains path to the application data folder.
_vFolder_CommonDesktop	Contains path to the all users desktop folder.
_vFolder_CommonPrograms	Contains path to the all users start menu programs folder.
_vFolder_CommonStartMenu	Contains path to the all users start menu folder.
_vFolder_Cookies	Contains path to the cookies folder.
_vFolder_Desktop	Contains path to the desktop folder.
_vFolder_Favourites	Contains path to the favorites folder.
_vFolder_Personal	Contains path to the personal folder.
_vFolder_Programs	Contains path to the start menu programs folder.
_vFolder_Recent	Contains path to the recent files folder.
_vFolder_SendTo	Contains path to the "send to" folder.
_vFolder_StartMenu	Contains path to the start menu folder.
_vFolder_Startup	Contains path to the start menu start up folder.
_vFolder_Templates	Contains path to the templates folder.
_vFolder_Windows	Contains path to the windows folder.
_vFolder_System	Contains path to the system folder.
_vFolder_Temp	Contains path to the temporary folder.
Keyboard & Mouse:
_vLastMouseClick	Contains last mouse click event in the <waitfor> command: <mlbu> - left button click <mmbu> - middle button click <mrbu> - right button click
_vLastKey	Contains last key pressed in the <waitfor> command.
_vMousePosX	Mouse cursor position in the screen coordinates - X.
_vMousePosY	Mouse cursor position in the screen coordinates - Y.
_vKeyReturn	'Return' (new line) key (use this key to add a new line to a text in variable).
_vKeyTab	'Tab' key (use this key to add 'tab' to a text in variable).
_vQuoteChar	“ character (use this key to add “ to a text).
_vKeySpace	“space” character
.
Drag & Drop:
_vDropFile_FileFullPath	Full path to the file dropped on the toolbar (ToolbarPro, ToolsWorks).
_vDropFile_FileName	File name of the file dropped on the toolbar.
_vDropFile_FileDir	Directory of the file dropped on the toolbar.
_vDropFile_Num	The number of files dropped
.
Other:
_vStrEmpty	Empty string (use this variable to assign empty string to a variable).
_vWinStarting	If the program is set to automatically start on windows startup then the _vWinStarting contains "YES" when the program is starting on windows startup.  Otherwise the value is "NO".
_vIsConnectedToInternet	If the computer is connected to the Internet the variable value is equal to YES otherwise it is NO.
.
Example:

<#> This macro shows how to use system variables
<#>
<execappex>("notepad.exe","","",0,0)

Active window title: <varout>("_vActiveWindow",0)
Current mouse position: (<varout>("_vMousePosX",0), <varout>("_vMousePosY",0))

System folders:
<varout>("_vFolder_AppData",0)
<varout>("_vFolder_CommonDesktop",0)
<varout>("_vFolder_CommonPrograms",0)
<varout>("_vFolder_CommonStartMenu",0)
<varout>("_vFolder_Cookies",0)
<varout>("_vFolder_Desktop",0)
<varout>("_vFolder_Favourites",0)
<varout>("_vFolder_Personal",0)
<varout>("_vFolder_Programs",0)
<varout>("_vFolder_Windows",0)
<varout>("_vFolder_System",0)


Control Keys

Normal keys (like A-Z, 0-9, Page Down, Tab, etc.) are represented by one character (for example,  A-Z, 0-9) or special key syntax (<pgdn>, <tab>) that means "press-and-release" key.    Control keys (e.g., Alt, Ctrl, Shift, etc.) that changes keyboard context are different.  The first occurrence of such key in the macro has meaning "press" key and the second occurrence has meaning "release" key.   This means that, for example, "Ctrl+K" is represented as "<ctrl>k<ctrl>".


<time>
<time> Inserts formatted time information (e.g., 2:09 AM) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  Insert Time

Syntax:

<time>(Shift, HourLZ, MinuteLZ, AmPm, TimeBase)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.
Can be a number or variable containing numeric value.

HourLZ

If 1, the hour is displayed with leading zero (e.g., 02).  If 0, the hour is displayed without leading zero (e.g., 2).
Can be a number or variable containing numeric value.

MinuteLZ

If 1, the minute is displayed with leading zero (e.g., 09).  If 0, the minute is displayed without leading zero (e.g., 9).
Can be a number or variable containing numeric value.

AmPm

If 1, "AM" (or "PM") is displayed next to the time (e.g., 2:09 AM).  It is not displayed If AmPm is 0.
Can be a number or variable containing numeric value.

TimeBase

If 0, the 24 hours time base is used.  If 1, the 12 hours time base is used.

Example:

Current time (24-hours base, no AM/PM) is: <time>(0,1,1,0,0)

Current time (12-hours base, with AM/PM) is: <time>(0,1,1,1,1)


<date>
<date> Inserts formatted date information (e.g., 02/24/2000) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  Insert Date

Syntax:

<date>(Format, Separator, DayLZ, MonthLZ, Shift)

Format

The format index (the first format has index 0).

Separator

Separator character: .,/- etc.

DayLZ

If 1, the day is displayed with leading zero (e.g., 02).  If 0, the day is displayed without leading zero (e.g., 2).

MonthLZ

If 1, the month  is displayed with leading zero (e.g., 09).  If 0, the month is displayed without leading zero (e.g., 9).

Shift

The date shift in days relative to the current date.  0 for no shift (today's date), -1 for date one day back (yesterday), +1 for date one day later (tomorrow), etc.

Example:

Current date is: <date>(1,"/",1,1,0)

Current date is: <date>(10,"/",1,1,0)

Yesterday: <date>(1,"/",1,1,-1)


<td:d>
<td:d> Inserts date's day into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Today: Day

Syntax:

<td:d>(Shift)

Shift

The date shift in days relative to the current date.  0 for no shift (today's date), -1 for date one day back (yesterday), +1 for date one day later (tomorrow), etc.

Example:

Today's day: <td:d>(0)

Tomorrow's day: <td:d>(1)


<td:dlz>
<td:dlz> Inserts date's day (with leading zero, e.g., 02) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Today: Day (leading zero)

Syntax:

<td:dlz>(Shift)

Shift

The date shift in days relative to the current date.  0 for no shift (today's date), -1 for date one day back (yesterday), +1 for date one day later (tomorrow), etc.

Example:

Today's day: <td:dlz>(0)

Tomorrow's day: <td:dlz>(1)


<td:m>
<td:m> Inserts date's month (e.g., 2) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Today: Month

Syntax:

<td:m>(Shift)

Shift

The date shift in days relative to the current date.  0 for no shift (today's date), -1 for date one day back (yesterday), +1 for date one day later (tomorrow), etc.

Example:

Today it is month: <td:m>(0)

Tomorrow it will be month: <td:m>(1)


<td:mlz>
<td:mlz> Inserts date's month (with leading zero, e.g., 02) into the currently active window

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Today: Month (leading zero)

Syntax:

<td:mlz>(Shift)

Shift

The date shift in days relative to the current date.  0 for no shift (today's date), -1 for date one day back (yesterday), +1 for date one day later (tomorrow), etc.

Example:

Today it is month: <td:mlz>(0)

Tomorrow it will be month: <td:mlz>(1)


<td:y>
<td:y> Inserts date's year (e.g., 2000) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Today: Year

Syntax:

<td:y>(Shift)

Shift

The date shift in days relative to the current date.  0 for no shift (today's date), -1 for date one day back (yesterday), +1 for date one day later (tomorrow), etc.

Example:

Today it is year: <td:y>(0)

Tomorrow it will be year: <td:y>(1)


<ct:h24>
<ct:h24> Inserts hour (e.g., 15) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: Hour (24)

Syntax:

<ct:h24>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:

Current time hour: <ct:h24>(0)

One minute later it will be hour: <ct:h24>(1)


<ct:h12>
<ct:h12> Inserts hour (e.g., 3) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: Hour (12)

Syntax:

<ct:h12>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:Current time hour: <ct:h12>(0)

One minute later it will be hour: <ct:h12>(1)


<ct:m>
<ct:m> Inserts minute (e.g., 6) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: Minute

Syntax:

<ct:m>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:

Current time minute: <ct:m>(0)

One minute later it will be: <ct:m>(1)


<ct:mlz>
<ct:mlz> Inserts minute with leading zero (e.g., 06) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: Minute (leading zero)

Syntax:

<ct:mlz>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:

Current time minute: <ct:mlz>(0)

One minute later it will be: <ct:mlz>(1)


<ct:h24lz>
<ct:h24lz> Inserts hour (e.g., 16) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: Hour (24)(leading zero)

Syntax:

<ct:h24lz>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:

Current time hour: <ct:h24lz>(0)

One minute later it will be hour: <ct:h24lz>(1)


<ct:h12lz>
<ct:h12lz> Inserts hour (e.g., 03) into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: Hour (12)(leading zero)

Syntax:

<ct:h12lz>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:

Current time hour: <ct:h12lz>(0)

One minute later it will be hour: <ct:h12lz>(1)


<ct:ampm>
<ct:ampm> Inserts "am" (or "pm") into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: a.m. / p.m.

Syntax:

<ct:ampm>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:

Morning or afternoon ? <ct:ampm>(0)

...and one minute later ?  <ct:ampm>(1)


<ct:ampm2>
<ct:AMPM> Inserts "AM" (or "PM") into the currently active window.

Command Tree:

Text, Date & Time, Keys  \  More Date & Time  \  Current time: AM / PM

Syntax:

<ct:AMPM>(Shift)

Shift

The time shift in minutes relative to the current time.  0 for no shift, -1 for time one minute back, +1 for time one minute later, etc.

Example:

Morning or afternoon ? <ct:AMPM>(0)

...and one minute later ?  <ct:AMPM>(1)


<execappex>
<execappex> Starts (executes) application.

Command Tree:

File  \  Start Application

Syntax:

<execappexe>("AppFile", "Params", "Dir", StartState, Reserved)

AppFile

(Full) path to the application's file (e.g., "c:\program files\app\app.exe").
Can be a static text or variable containing text.

Params

List of parameters the application should be started with (e.g., "/n /g").
Can be a static text or variable containing text.

Dir

Start up directory.  The directory is made current before the application is started.
Can be a static text or variable containing text.

StartState

The state of the window:
0 - Normal
1 - Maximized
2 - Minimized
Can be a number or variable containing numeric value.

Reserved

Must be 0.

Example:<#> This command starts Notepad maximized.

<#>

<execappex>("notepad.exe","","",1,0)


<fileopen>
<fileopen> Opens file within the associated application.

Command Tree:

File  \  Open

Syntax:

<fileopen>("File", WindowState)

File

Full path to the file to open (e.g., "c:\mydocuments\letter1.doc").
Can be a static text or variable containing text.

WindowState

The state of the window:
0 – Normal
1 - Maximized
2 - Minimized
Can be a number or variable containing numeric value.

Example:

<#> This command opens file you select

<#>

<commands_only_on>

<varset>("vFile=_vStrEmpty","")

<varchng>("vFile","SF","")

<fileopen>("vFile",0)


<filecreate>
<filecreate> Creates a new empty file.

Command Tree:File  \  Create

Syntax:

<filecreate>("File", Reserved)

File

Full path to the file to create (e.g., "c:\mydocuments\empty.doc").
Can be a static text or variable containing text.

Reserved

Must be 0.

Example:

<#> This command opens file you select

<#>

<filecreate>("c:\newfile.txt",0)


<filecopy>
<filecopy> Copies file(s).

Command Tree:

File  \  Copy

Syntax:

<filecopy>("FileSource", "FileDestination", SubDir, Reserved)

FileSource

Full path to the file to copy  (e.g., "c:\mydocuments\original.doc").  The file path can contain wildcard characters (*?).  In such the case all the files matching the pattern are copied.
Can be a static text or variable containing text.

FileDestination

Full path to the new file (e.g., "c:\mydocuments\copy.doc").  If the FileSource contains wildcard characters the FileDestination must specify directory (e.g., "c:\mydocuments") where multiple files are copied.
Can be a static text or variable containing text.

SubDir

Takes effect only if the FileSource contains wildcard characters.  If 1, files from all the sub directories are copied as well (if matching the pattern).  If 0, files from sub directories are not copied.

Reserved

Must be 0.

Example:

<#> This macro copies file you select to the file "c:\filecopy.txt"

<#>

<commands_only_on>

<varset>("vFile=_vStrEmpty","")

<varchng>("vFile","SF","") <#> Select file

<filecopy>("vFile","c:\filecopy.txt",0,0)


<filemove>
<filemove> Moves file(s).

Command Tree:

File  \  Move

Syntax:

<filemove>("FileSource", "FileDestination", SubDir, Reserved)

FileSource

Full path to the file to move (e.g., "c:\mydocuments\original.doc").  The file path can contain wildcard characters (*?).  In such the case all the files matching the pattern are moved.
Can be a static text or variable containing text.

FileDestination

Full path to the new file (e.g., "c:\mydocuments\copy.doc").  If the FileSource contains wildcard characters the FileDestination must specify directory (e.g., "c:\mydocuments") where multiple files are moved.
Can be a static text or variable containing text.

SubDir

Takes effect only if the FileSource contains wildcard characters.  If 1, files from all the sub directories are moved as well (if matching the pattern).  If 0, files from sub directories are not moved.

Reserved

Must be 0.

Example:<#> This macro moves file you select to the file "c:\filemove.txt"

<#>

<commands_only_on>

<varset>("vFile=_vStrEmpty","")

<varchng>("vFile","SF","")

<filemove>("vFile","c:\filemove.txt",0,0)


<filedel>
<filedel> Deletes file(s).

Command Tree:

File  \  Delete

Syntax:

<filedel>("File", SubDir, Reserved)

File

Full path to the file to delete (e.g., "c:\mydocuments\original.doc").  The file path can contain wildcard characters (*?).  In such the case all the files matching the pattern are deleted.

SubDir

Takes effect only if the File contains wildcard characters.  If 1, files from all the sub directories are deleted as well (if matching the pattern).  If 0, files from sub directories are not deleted.

Reserved

Must be 0.

Example:

<#> This macro deletes the file you select

<#>

<commands_only_on>

<varset>("vFile=_vStrEmpty","")

<varchng>("vFile","SF","")

<filedel>("vFile",0,0)


<fileinfo>
<fileinfo> Provides information (size, creation time, last access time, last modification time) about specified file.

Command Tree:

File  \  File Info

Syntax:

<fileinfo>("File", "Info", "ResultVar")

File

Full path to the file (e.g., "c:\mydocuments\file.doc").

Info

Specifies the type of information to be retrieved.  Can be one of the following values:
"SIZE"                  - retrieves file size
"TIME_WRITE"     - retrieves the last modification time
"TIME_ACCESS" - retrieves the last access time
"TIME_CREATE"  - retrieves the creation time

ResultVar

Variable that receives the result.

Example:

<#> This macro retrieves information about the file you select

<#>

<commands_only_on>

<varset>("vFile=_vStrEmpty","")

<varset>("vFileInfo=The selected file information:","")

<varchng>("vFile","SF","")

<fileinfo>("vFile","SIZE","vFileSize")

<fileinfo>("vFile","TIME_WRITE","vFileTime")

<varchng>("vFileInfo","A","_vKeyReturn")

<varchng>("vFileInfo","A","File name: ")

<varchng>("vFileInfo","A","vFile")

<varchng>("vFileInfo","A","_vKeyReturn")

<varchng>("vFileInfo","A","File size: ")

<varchng>("vFileInfo","A","vFileSize")

<varchng>("vFileInfo","A"," Bytes")

<varchng>("vFileInfo","A","_vKeyReturn")

<varchng>("vFileInfo","A","Last modified: ")

<varchng>("vFileInfo","A","vFileTime")

<msg>(100,100,"vFileInfo","File Info",1)


<data_load>
<data_load> Loads textual data from file (whole the content) and saves them in variable for other processing within the macro.

Command Tree:

File  \  Load Data

Syntax:

<data_load>("Variable", "File", "Reserved")

Variable

Variable that receives the file content (text).

File

Full path to the file with data (e.g., "c:\mydocuments\data.txt").

Reserved

Must be empty string "".

Example:

<#> This macro loads the file content to variable

<#>

<commands_only_on>

<varset>("vFileData=_vStrEmpty","")

<varchng>("vFile","SF","")

<data_load>("vFileData","vFile","")

<msg>(100,100,"vFileData","File Content",1)


<data_save>
<data_save> Save textual data to file.

Command Tree:

File  \  Save Data

Syntax:

<data_save>("Text", "File", "Mode")

Text

Text to be saved (or variable containing text to be saved).

File

Full path to the file with data (e.g., "c:\mydocuments\data.txt").

Mode

Can be one of the following values:
"A" - the data will be appended to the end of the file
"" - (empty) the data will be written to the begin of the file

Example:

<#> This macro adds date to the end of the file.

<#>

<commands_only_on>

<varchng>("vFile","SF","")

<varset>("vData=_vKeyReturn","")

<varchng>("vData","A","_vCurrDate_MMDDYYYY")

<data_save>("vData","vFile","A")


<dircreate>
<dircreate> Creates new directory.

Command Tree:

Directory  \  Create

Syntax:

<dircreate>("Dir", Reserved)

Dir

Full path to the directory to be created (e.g., "c:\mydocuments\new").

Reserved

Must be 0.

Example:

<#> This macro creates new directory "c:\newdir"

<#>

<dircreate>("c:\newdir",0)


<diropen>
<diropen> Opens directory in Windows Explorer.

Command Tree:

Directory  \  Open

Syntax:

<diropen>("Dir", WinState)

Dir

Full path to the directory to be opened (e.g., "c:\mydocuments").

WinState

The state of the window:
0 - Normal
1 - Maximized
2 - Minimized

Example:

<#> This macro opens directory "c:\"

<#>

<diropen>("c:\",1)


<dircopy>
<dircopy> Copies directory including all subdirectories.

Command Tree:

Directory  \  Copy

Syntax:

<dircopy>("SourceDir", "DestDir", Reserved, Reserved)

SourceDir

Full path to the source directory (e.g., "c:\mydocuments").

DestDir

Full path to the destination directory (e.g., "c:\backup").

Reserved

Must be 0.

Reserved

Must be 0.

Example:

<#> This macro copies directory you select to other directory you select.

<#>

<commands_only_on>

<msg>(100,100,"Select the directory you want to copy.","Message",0)

<varchng>("vDirSource","SD","")

<msgoff>

<msg>(100,100,"Select the destination directory .","Message",0)

<varchng>("vDirDest","SD","")

<msgoff>

<msg>(100,100,"Directory copy is in progress. Please wait....","Message",0)

<dircopy>("vDirSource","vDirDest",0,0)

<msgoff>


<dirmove>
<dirmove> Moves directory including all subdirectories.

Command Tree:

Directory  \  Move

Syntax:

<dirmove>("SourceDir", "DestDir", Reserved, Reserved)

SourceDir

Full path to the source directory (e.g., "c:\mydocuments").

DestDir

Full path to the destination directory (e.g., "c:\newdocs").

Reserved

Must be 0.

Reserved

Must be 0.

Example:

<#> This macro copies directory you select to other directory you select.

<#>

<commands_only_on>

<msg>(100,100,"Select the directory you want to move.","Message",0)

<varchng>("vDirSource","SD","")

<msgoff>

<msg>(100,100,"Select the destination directory .","Message",0)

<varchng>("vDirDest","SD","")

<msgoff>

<msg>(100,100,"Directory move is in progress. Please wait....","Message",0)

<dirmove>("vDirSource","vDirDest",0,0)

<msgoff>


<dirdel>
<dirdel> Deletes directory including all subdirectories.  The directory doesn't have to be empty - all the files in the directory are deleted.

Command Tree:

Directory  \  Delete

Syntax:

<dirdel>("Dir", Reserved)

Dir

Full path to the directory to delete (e.g., "c:\olddata").

Reserved

Must be 0.

Example:

<#> This macro deletes directory you select

<#>

<commands_only_on>

<msg>(100,100,"Select the directory you want to delete.","Message",0)

<varchng>("vDir","SD","")

<msgoff>

<dirdel>("vDir",0)


<wwwopen>
<wwwopen> Opens web page in your default web browser.

Command Tree:

Internet  \  Open Web page

Syntax:

<wwwopen>("WebLink", WindowState)

WebLink

Link (URL) to the web page (e.g., "http://www.softwareutilities.com").  The link must contain http://, https://, etc. prefix.

WindowState

The state of the window:
0 - Normal
1 - Maximized
2 - Minimized

Example:

<#> This command opens pitrinec.com web page

<#>

<wwwopen>("http://wwww.pitrinec.com",0)


<email>
<email> Creates new e-mail message using default e-mail client.

Command Tree:

Internet  \  E-mail

Syntax:

<email>("Address", WindowState)

Address

E-mail address (e.g., support@mycompany.com).  The address can be empty.

WindowState

The state of the window:
0 - Normal
1 - Maximized
2 - Minimized

Example:

<#> This command creates new mail message

<#>

<email>("",0)


<ftp_getfile>
<ftp_getfile> Downloads file from a remote FTP server.

Command Tree:

Internet  \  FTP   \  Download File

Syntax:

<ftp_getfile>("LocalFile", "RemoteFile", "UserName", "Password")

LocalFile

Full path to the file on local machine.  If the file already exists it will be overwritten without a prior prompt.

RemoteFile

Full path to the remote file (e.g., ftp://softwareutilities.com/about.txt).

UserName

User login name.  If empty the "anonymous" is considered.

Password

User name login password.

Example:

<#> This macro downloads "about.txt" file from pitrinec.com

<#> FTP server and saves it in "c:\about.txt"

<#>

<ftp_getfile>("c:\about.txt","ftp://pitrinec.com/ftp/about.txt","","")


<ftp_putfile>
<ftp_putfile> Uploads file from local machine to a remote FTP server.

Command Tree:

Internet  \  FTP   \  Upload File

Syntax:

<ftp_putfile>("LocalFile", "RemoteFile", "UserName", "Password")

LocalFile

Full path to the file on local machine.  If the file already exists it will be overwritten without a prior prompt.

RemoteFile

Full path to the remote file (e.g., ftp://softwareutilities.com/about.txt).

UserName

User login name.  If empty the "anonymous" is considered.

Password

User name login password.

Example:

<#> This macro uploads file to an FTP server

<#>

<commands_only_on>

<form_item>("fm1","Remote file:","EDIT","","vRemoteFile")

<form_item>("fm1","Local file:","EDIT","","vLocalFile")

<form_item>("fm1","User:","EDIT","","vUser")

<form_item>("fm1","Password:","EDIT","","vPassword")

<form_show>("fm1","File Upload","shell32.dll",14)

<ftp_putfile>("vLocalFile","vRemoteFile","vUser","vPassword")


<ftp_delfile>
<ftp_delfile> Deletes file from a remote FTP server.

Command Tree:

Internet  \  FTP   \  Delete File

Syntax:

<ftp_delfile>("Reserved", "RemoteFile", "UserName", "Password")

Reserved

Must be empty.

RemoteFile

Full path to the remote file (e.g., ftp://softwareutilities.com/about.txt).

UserName

User login name.  If empty the "anonymous" is considered.

Password

User name login password.

Example:

<#> This macro deletes file from FTP server

<#>

<commands_only_on>

<form_item>("fm1","Remote file to delete:","EDIT","","vRemoteFile")

<form_item>("fm1","User:","EDIT","","vUser")

<form_item>("fm1","Password:","EDIT","","vPassword")

<form_show>("fm1","FTP: Delete File","shell32.dll",32)

<ftp_delfile>("","vRemoteFile","vUser","vPassword")


<ftp_renamefile>
<ftp_renamefile> Renames file on a remote FTP server.

Command Tree:

Internet  \  FTP   \  Rename File

Syntax:

<ftp_renamefile>("RemoteOldlFile", "RemoteNewFile", "UserName", "Password")

RenameOldFile

Full path to the original remote file (e.g., ftp://softwareutilities.com/original.txt).

RemoteNewFile

Full path to the remote new file (e.g., ftp://softwareutilities.com/renamed.txt).

UserName

User login name.  If empty the "anonymous" is considered.

Password

User name login password.

Example:

<#> This macro uploads file to an FTP server

<#>

<commands_only_on>

<form_item>("fm1","Remote file - old name:","EDIT","","vRemoteFileOld")

<form_item>("fm1","Remote file - new name:","EDIT","","vRemoteFileNew")

<form_item>("fm1","User:","EDIT","","vUser")

<form_item>("fm1","Password:","EDIT","","vPassword")

<form_show>("fm1","File Rename","shell32.dll",1)

<ftp_renamefile>("vRemoteFileOld","vRemoteFileNew","vUser","vPassword")


<ftp_createdir>
<ftp_createdir> Creates new directory on a remote FTP server.

Command Tree:

Internet  \  FTP   \  Create Directory

Syntax:

<ftp_createdir>("Reserved", "RemoteDir", "UserName", "Password")

Reserved

Must be empty.

RemoteDir

Full path to the remote directory to create (e.g., ftp://softwareutilities.com/newdir).

UserName

User login name.  If empty the "anonymous" is considered.

Password

User name login password.

Example:

<#> This macro creates new directory on FTP server

<#>

<commands_only_on>

<form_item>("fm1","Remote directory to create:","EDIT","","vRemoteDir")

<form_item>("fm1","User:","EDIT","","vUser")

<form_item>("fm1","Password:","EDIT","","vPassword")

<form_show>("fm1","FTP: Create Directory","shell32.dll",3)

<ftp_createdir>("","vRemoteDir","vUser","vPassword")


<ftp_deldir>
<ftp_deldir> Deletes directory on a remote FTP server.

Command Tree:

Internet  \  FTP   \  Delete Directory

Syntax:

<ftp_deldir>("Reserved", "RemoteDir", "UserName", "Password")

Reserved

Must be empty.

RemoteDir

Full path to the remote directory to delete (e.g., ftp://softwareutilities.com/dir).

UserName

User login name.  If empty the "anonymous" is considered.

Password

User name login password.

Example:

<#> This macro deletes directory on FTP server

<#>

<commands_only_on>

<form_item>("fm1","Remote directory to delete:","EDIT","","vRemoteDir")

<form_item>("fm1","User:","EDIT","","vUser")

<form_item>("fm1","Password:","EDIT","","vPassword")

<form_show>("fm1","FTP: Delete Directory","shell32.dll",31)

<ftp_deldir>("","vRemoteDir","vUser","vPassword")


<actwin>
<actwin> Activates specified window.  If the window doesn't exist a macro can be started (to open desired application or notify user, for example).

Command Tree:

Window  \  Activate

Syntax:

<actwin>("WinTitle", Match, WindowState, "MacroRun")

WinTitle

Title of the window to activate.

Match

Can be one of these values:
0 - WinTitle can be substring of a window title
1 - WinTitle must exactly match a window title

WindowState

Desired state of the window after the window is activated:
0 - Normal
1 - Minimized
2 - Maximized
3 - Let the state unchanged

MacroRun

Name of the macro to run if the WinTitle doesn't match any existing window.  The "no" value means no macro will be run.

Example:

<#> This macro activates "Notepad" window if it is opened

<#>

<commands_only_on>

<if_win>("Notepad","OPEN",0)

   <actwin>("Notepad",0,0,"no")

<else>

   <msg>(100,100,"'Notepad' is not opened!","Message",1)

<endif>


<winmove>
<winmove> Moves specific window to defined position.

Command Tree:

Window  \  Mov

Syntax:

<winmove>("WinTitle", Match, Xpos, Ypos)

WinTitle

Title of the window to move.

Match

Can be one of these values:
0 - WinTitle can be substring of a window title
1 - WinTitle must exactly match a window title

Xpos

X-coordinate of desired window position

Ypos

Y-coordinate of desired window position

Example:

<#> This macro moves "Notepad" window to position (32,32)

<#>

<commands_only_on>

<if_win>("Notepad","OPEN",0)

   <winmove>("Notepad",0,32,32)

<else>

   <msg>(100,100,"'Notepad' is not opened!","Message",1)

<endif>


<winresize>
<winresize> Resizes specific window.

Command Tree:

Window  \  Resize

Syntax:

<winresize>("WinTitle", Match, Width, Height)

WinTitle

Title of the window to resize.

Match

Can be one of these values:
0 - WinTitle can be substring of a window title
1 - WinTitle must exactly match a window title

Width

Desired window's width

Height

Desired  window's height

Example:

<#> This macro resizes "Notepad" window to size 300x200

<#>

<commands_only_on>

<if_win>("Notepad","OPEN",0)

   <winresize>("Notepad",0,300,200)

<else>

   <msg>(100,100,"'Notepad' is not opened!","Message",1)

<endif>


<winstate>
<winstate> Changes window's state.

Command Tree:

Window  \  Change State

Syntax:

<winstate>("WinTitle", "State")

WinTitle

Title of the window.

State

Can be one of these values:
"MIN"
"RESTORE"
"MAX"
"ALWAYS_TOP"
"NOT_ALWAYS_TOP"
"HIDE"
"SHOW"

Example:

<#> This macro minimizes "Notepad" window

<#>

<commands_only_on>

<if_win>("Notepad","OPEN",0)

   <winstate>("Notepad","MIN")

<else>

   <msg>(100,100,"'Notepad' is not opened!","Message",1)

<endif>


<winclose>
<winclose> Closes required window.

Command Tree:

Window  \  Close

Syntax:

<winclose>("WinTitle", Match)

WinTitle

Title of the window.

Match

Can be one of these values:
0 - WinTitle can be substring of a window title
1 - WinTitle must exactly match a window title

Example:

<#> This macro closes "Notepad" window

<#>

<commands_only_on>

<if_win>("Notepad","OPEN",0)

   <winclose>("Notepad",0)

<else>

   <msg>(100,100,"'Notepad' is not opened!","Message",1)

<endif>


<clpsave>
<clpsave> Saves clipboard content (all data in all the formats available) to file.

Command Tree:

Clipboard  \  Save clipboard content to file

Syntax:

<clpsave>("File")

File

Full path to the file that receives clipboard data.

Example:

<#> This example saves clipboard data to file c:\clpdata.clx

<#>

<clpsave>("c:\clpdata.clx")


<clpload>
<clpload> Loads clipboard content from file (previously created using <clpsave> command or by "Tools\Save Clipboard Data To File" menu item).  This command changes clipboard content.

Command Tree:

Clipboard  \  Load clipboard content from  file

Syntax:

<clpload>("File")

File

Full path to the file that contains clipboard data (previously created using <clpsave> command or by "Tools\Save Clipboard Data To File" menu item).

Example:

<#> This example loads clipboard data from file "c:\clpdata.clx"

<#>

<commands_only_on>

<if_file>("c:\clpdata.clx","EXIST","")

   <clpload>("c:\clpdata.clx")

<else>

   <msg>(100,100,"The file 'c:\clpdata.clx' doesn't exist.","Message",1)

<endif>


<clppastetext>
<clppastetext> Pastes (inserts) text to destination application (document) through clipboard.

Command Tree:

Clipboard  \  Paste text

Syntax:

<clppastetext>("Text")

Text

Text to be pasted to destination application (document).

Example:

<#> This macro pastes "Hello!" into the Notepad

<#>

<commands_only_on>

<if_win>("Notepad","OPEN",0)

   <actwin>("Notepad",0,0,"no")

   <clppastetext>("Hello!")

<else>

   <msg>(100,100,"'Notepad' is not opened!","Message",1)

<endif>


<clpput>
<clpput> Puts text data to clipboard.  This command changes clipboard content.

Command Tree:

Clipboard  \  Put data to clipboard

Syntax:

<clpput>("Text")

Text

Text to be put into the clipboard.

Example:

<#> This macro puts data you type to clipboard

<#>

<commands_only_on>

<varset>("vData=","Type text you want to put to clipboard")

<clpput>("vData")


<shutdown>
<shutdown> Exit Windows, shutdown computer, log off user.

Command Tree:

System  \  Shut Down

Syntax:

<shutdown>("How", Force)

How

Can be one of these values:
"LOGOFF"
"REBOOT"
"SHUTDOWN"
"POWEROFF"

Force

If 1, the shutdown will proceed even if there is an application that refuses shutdown due unsaved data or other reason.  In such the case there can be a data loss.  If 0, the shutdown will proceed only if all the running applications accepts system shutdown query.

Example:

<#> This macro will reboot computer

<#>

<shutdown>("REBOOT",0)


<setsystime>
<setsystime> Sets system time.

Command Tree:

System  \  Set System Time

Syntax:

<setsystime>(Hour, Minute, Second)

Hour

Hour of the newly set system time.

Minute

Minute of the newly set system time.

Second

Second of the newly set system time.

Example:

<#> This macro will set system time to 05:00:00

<#>

<setsystime>(5,0,0)


<setsysdate>
<setsysdate> Sets system date.

Command Tree:

System  \  Set System Date

Syntax:

<setsysdate>(Year, Month, Day)

Year

Year of the newly set date.

Month

Month of the newly set date.

Day

Day of the newly set date.

Example:

<#> This macro will set system date Feb 1, 2000

<#>

<setsysdate>(2000,2,1)


<beep>
<beep> Play sound.

Command Tree:

System  \  Play Sound

Syntax:

<beep>("SoundFile", Repeat)

SoundFile

Full path to the file (.wav) to play.

Repeat

How many times the sound should be repeated.

Example:

<#> This macro will play the sound file you select

<#>

<commands_only_on>

<varset>("vSoundFile=*.wav","")

<varchng>("vSoundFile","SF","")

<beep>("vSoundFile",1)


<post_win_msg>
<post_win_msg> Posts Windows message (the same as PostMessage Windows API call).   (This command is intended for Windows programmers and experts.)

Command Tree:

System  \  Post Windows Msg

Syntax:

<post_win_msg>(Win, Msg, WParam, LParam)

Win

Can be either:
1 - Window title (partial string).
2 - Variable.
3 - Window handle (decimal number).

Msg

Windows message ID (decimal number).

WParam

WParam parameter of the Windows message (decimal number).

LParam

LParam parameter of the Windows message (decimal number).

Example:

<#> This macro will start playing in WinAmp (the same as clicking on the "Play" button).

<#>

<post_win_msg>(winamp, 273, 40045, 0)


<msg>
<msg> Shows message window.

Command Tree:

Message  \  Show Message

Syntax:

<msg>(Xpos, Ypos, "MessageText", "Title", OKButton)

Xpos

X-coordinate of the message window position.

Ypos

Y-coordinate of the message window position.

MessageText

Text you want to display in the message window.

Title

Title of the message window.

OKButton

Can be one of these values:
0 - OK button is not shown.  The <msgoff> command must be used to close the message window.
1 - OK button is shown in the message window.

Example:

<#> This macro will display message window

<#>

<msg>(100,100,"This is a message to notify user just about anything....","Message",1)


<mm>
<mm> Moves mouse cursor to required position.  The position is in absolute screen coordinates by default.  There are these three commands that can precede the <mm> command and change the mouse move coordinates meaning:

<mousemove_absolute> - mouse cursor position is in absolute screen coordinates
<mousemove_relative_win> - mouse cursor position is relative to currently active window
<mousemove_relative_pos> - mouse cursor position is relative to current mouse cursor position

Command Tree:

Mouse  \  Move

Syntax:

<mm>(Xpos, Ypos)

Xpos

X-coordinate of the new mouse cursor position.

Ypos

X-coordinate of the new mouse cursor position.

Example:

<#> This macro moves the mouse cursor to position (100,100)

<#> and than - after 2 seconds - to position (-10, -10) relative to

<#> position (100, 100)

<commands_only_on>

<mm>(100,100)

<wx>(2000)

<mousemove_relative_pos>

<mm>(-10,-10)


<varset>
<varset> Declares variable and sets its value.

Command Tree:

Variables  \ Set

Syntax:

<varset>("Variable", "MessageTitle")

Variable

Defines variable and its value in the form VARIABLE_NAME=VALUE.  Variable can be any string (different from system variables).  The value can be either constant string or other variable or empty string.  There are four basic behaviors of the command:
1. VALUE is supplied.  In such case the variable is assigned the VALUE.  For example, "vNumber=10" or "vName=John".
2. List of possible values is  supplied in VALUE.  Each single item in the list is separated by "|" character.  For example, "vNames=Jane|Paul|Chris|Michae".
3. VALUE is an empty string ("vName=").  In such the case, a dialog window with the MessageTitle appears and prompts user to enter the variable value.  Note:  To assign an empty string to the variable use this construction: "vEmptyStr=_vStrEmpty".
4. VALUE is equal to "YES/NO".  In such the case, a "yes/no" message box withMessageTitle appears.  If user selects "yes" button the "YES" value is assigned to the variable.  If the user selects "no" button the "NO" value is assigned.  For example, "vDoYouWant=YES/NO".

MessageTitle

A title of the window that appears in cases 1 and 3 above.

Example:

<#> This macro demonstrates <varset> command

<#>

<commands_only_on>

<varset>("vName=","Insert Your Name")

<varset>("vShow=YES/NO","Do you want to see your name ?")

<if_str>("vShow==YES")

   <msg>(100,100,"vName","Your name is:",1)

<endif>

<varset>("vName=Jane|Paul|Michael|Chris","Who is my best friend ?")

<if_str>("vName==Jane")

   <msg>(100,100,"Yes!","Message",1)

<else>

   <msg>(100,100,"No!","Message",1)

<endif>


<varchng>
<varchng> Modifies (changes) variable's value.

Command Tree:

Variables  \  Modify

Syntax:

<varchng>("Variable", "Operation", "Operand")

Variable

Variable.

Operation

There are these operations available:
"A" - appends string (Operand) to the Variable.
"L" - extracts left substring and saves it in the Variable.  The number of the characters extracted is specified by Operand.
"R" - extracts right substring and saves it in the Variable.  The number of the characters extracted is specified by Operand.
"UC" - converts the Variable string to uppercase.
"LC" - converts the Variable string to lowercase.
"LNT" - saves the length of the string defined by Operand in the Variable.
"+" - Variable = Variable + Operand.
"-" - Variable = Variable - Operand.
"*" - Variable = Variable * Operand.
"/" - Variable = Variable / Operand.
"SF" - select file.  A "select file" dialog is shown and the file (full path) the user selects is saved in the Variable.  The initial path is defined by Variable.  The Operand is not used.
"SD" - select folder (directory).  A "select folder" dialog is shown and the directory (full path) the user selects is saved in the Variable.  The initial path is defined by Variable.  The Operand is not used.
"GC" - get clipboard.  The text from clipboard is saved in the Variable.

“RAND” – generates random number.  The Operand defines maximum number generated.  It cannot be bigger than 30000.

“GW” – Gets a word from an input text.  The Operand (variable) contains the text you want to get a word from.  Before this command is called, the Variable contains index of the word to retrieve.  After the command is called, the Variable is overwritten by the word retrieved.

“GL” – Gets a line (row) from an input text.  The Operand (variable) contains the text you want to get a line from.  Before this command is called, the Variable contains index of the line to retrieve.  After the command is called, the Variable is overwritten by the line retrieved.

Operand

Depends on the Operation above.

Example:

<#> This macro demonstrates <varchng> command

<#>

<commands_only_on>

<varchng>("vFile","SF","")

<varset>("vFileUppercase=vFile","")

<varchng>("vFileUppercase","UC","")

<msg>(100,100,"vFileUppercase","File Selected",1)


<varout>
<varout> Sends (outputs) variable's value to the active window as a sequence of keystrokes or through the clipboard.

Command Tree:

Variables  \  Send

Syntax:

<varout>("Variable", Clipboard)

Variable

Variable to send out.

Clipboard

If 1, the variable value is send to the active window through the clipboard.
If 0, the variable value is send to the active window as a sequence of keyboard keystrokes.

Example:

<#> This macro demonstrates use of <varout> command

<#> The macro activates Notepad and writes a text in it.

<#>

<commands_only_on>

<if_win>("Notepad","OPEN",0)

   <actwin>("Notepad",0,0,"no")

   <if_win>("Notepad","ACT",0)

      <varset>("vText=This is Notepad","")

      <varout>("vText",0)

   <endif>

<else>

   <msg>(100,100,"Notepad is not running.","Message",1)
<endif>)


<var_load>
<var_load> Loads variable value from a file.  (The value was previously saved using <var_save> command.)

Command Tree:

Variables  \  Load Variable From File

Syntax:

<var_load>("Variable", "File")

Variable

Variable to load value from file.

File

The file created by <var_save> command that contains variable value.

Example:

<#> This macro demonstrates use of <var_load> and <var_save> commands

<#>

<commands_only_on>

<varset>("vName=John","")

<var_save>("vName","c:\_myvars.dat")

<varset>("vName=Michael","")

<var_load>("vName","c:\_myvars.dat")

<msg>(100,100,"vName","Message",1)


<var_save>
<var_save> Saves (persists) variable value to a file.

Command Tree:

Variables  \  Save Variable To File

Syntax:

<var_save>("Variable", "File")

Variable

Variable to save value to file.

File

The file to save variable value to.

Example:

<#> This macro demonstrates use of <var_load> and <var_save> commands

<#>

<commands_only_on>

<varset>("vName=John","")

<var_save>("vName","c:\_myvars.dat")

<varset>("vName=Michael","")

<var_load>("vName","c:\_myvars.dat")

<msg>(100,100,"vName","Message",1)


<run>
<run> Runs other macro (specified by name).

Command Tree:

Macro Flow Control    \  Calls  \  Run Other Macro

Syntax:

<run>("MacroName")

MacroName

Name of the macro to run.  (The macro name should be unique if it is run from other macros using <run> command).

Example:

<#> This macro runs other macro (if exists)

<#>

<run>("_macro_to_run")


<extmacro>
<extmacro> Runs macro saved in external text file.  This command can be used for sharing macros among local network users (if the macro files are saved on a network drive accessible by multiple users.)

Command Tree:

Macro Flow Control    \  Calls  \  Run External Macro

Syntax:

<extmacro>("MacroFile", Clipboard)

MacroFile

Name of the macro to run.  (The macro name should be unique if it is run from other macros using <run> command).

Clipboard

If 1, the text from the MacroFile is inserted to the active window through the clipboard.  (This option is intended only for plain text with no commands.)
If 0, the macro from the MacroFile is played back the same way as it was regular macro.

Example:

<#> This macro starts macro from external file.

<#>

<extmacro>("_extmacro.txt",0)


<listbox>
<listbox> Displays list of macros to choose from.

Command Tree:

Macro Flow Control    \  Calls  \  Macro List Box

Syntax:

<listbox>("WinTitle", "Macro1-Name", "Macro1-Description, "Macro2-Name", "Macro2-Description"...)

WinTitle

Title of the window that appears.

Macro1-Name

Name of the macro to run (first item in the selection box).

Macro1-Description

Description of the macro to run (first item in the selection box).

Macro2-Name

Name of the macro to run (second item in the selection box).

Macro2-Description

Description of the macro to run (second item in the selection box).

Example:

<#> This macro shows you how to use <listbox> command

<#>

<listbox>("Select your option","_item1","1. Item","_item2","2. Item","_item3","3. Item")


<if_str>
<if_str> Condition statement compares two (string) variables or a (string) variable with a constant text.

Command Tree:

Macro Flow Control    \  If-Else  \  If (compare strings)

Syntax:

<if_str>("Condition")

Condition

Condition in one of these forms:
V1==V2
V1!=V2
V1<=V2
V1<V2
V1>=V2
V1>V2
V1~=V2

V1 must be a variable, V2 can be either variable or a constant text.  The operators have this meaning:
== "is equal"
!= "is not equal"
"<" is smaller (for example, “abc” is smaller than “abx”)
“<=” is smaller or equal
">" is bigger
">=" is bigger or equal
"~=" contains sub-string (V1 is a sub-string of V2)

Example:

<#> This example shows how to use "if_str" command.

<#>

<commands_only_on>

<varset>("vChar=","Insert one character (a-z)")

<if_str>("vChar>=k")

   <msg>(100,100,"The character is bigger or equal to 'k'.","Message",1)

<else>

   <msg>(100,100,"The character is smaller than 'k'.","Message",1)

<endif>


<if_num>
<if_num> Condition statement compares two (numerical) variables or a (numerical) variable with a constant number.

Command Tree:

Macro Flow Control    \  If-Else  \  If (compare numbers)

Syntax:

<if_num>("Condition")

Condition

Condition in one of these forms:
V1==V2
V1!=V2
V1<=V2
V1<V2
V1>=V2
V1>V2
V1~=V2

V1 must be a variable, V2 can be either variable or a constant number.  The operators have this meaning:
== "is equal"
!= "is not equal"
"<" is smaller
“<=” is smaller or equal
">" is bigger
">=" is bigger or equal

Example:

<#> This example shows how to use "if_num" command.

<#>

<commands_only_on>

<varset>("vNum=","Insert number smaller than 10:")

<if_num>("vNum>=5")

   <msg>(100,100,"The number is bigger or equal to 5.","Message",1)

<else>

   <msg>(100,100,"The number is smaller than 5.","Message",1)

<endif>


<if_win>
<if_win> Window-related condition.

Command Tree:

Macro Flow Control    \  If-Else  \  If Window

Syntax:

<if_win>("WinTitle", "Condition", Match)

WinTitle

Title of the window to check against the Condition.

Condition

Condition can be one from  the following:
"OPEN" - the <if_win> statement is true if window with the WinTitle is opened (exist).
"CLOSE" - the <if_win> statement is true if window with the WinTitle is not opened (no more exist).
"ACT" - the <if_win> statement is true if window with the WinTitle is active (top most, receives keyboard events).
"NOACT" - the <if_win> statement is true if window with the WinTitle is not active (not receives keyboard events).

Match

If 1, WinTitle must exactly match a window title.
If 0, WinTitle can be a substring of a window title.

Example:

<#> This macro shows how to use if-win command

<#>

<commands_only_on>

<if_win>("notepad","OPEN",0)

   <if_win>("Notepad","ACT",0)

      <msg>(100,100,"Notepad is opened and active.","Message",1)

   <else>

      <msg>(100,100,"Notepad is opened but not active.","Message",1)

   <endif>

<else>

   <msg>(100,100,"Notepad is not opened.","Message",1)

<endif>


<if_file>
<if_file> File-related condition.

Command Tree:

Macro Flow Control    \  If-Else  \  If File

Syntax:

<if_file>("File", "Condition", "Operand")

File

Full path to the file to check against the Condition.

Condition

Condition can be one from  the following:
"EXIST" - the <if_file> statement is true if the file exist.
"NOTEXIST" - the <if_file> statement is true if the file does not exist.
"BIGGER" - the <if_file> statement is true if the file size is bigger than the Operand.
"SMALLER" - the <if_file> statement is true if the file size is smaller than the Operand.

Operand

Takes effect only if Condition is "BIGGER" or "SMALLER".

Example:

<#> This macro shows how to use if-file condition

<#>

<commands_only_on>

<if_file>("winmine.exe","EXIST","122222")

   <msg>(100,100,"Minesweeper game is installed.","Message",1)

<else>

   <msg>(100,100,"Minesweeper game is NOT installed.","Message",1)

<endif>


<if_dir>
<if_dir> Directory (folder) - related condition.

Command Tree:

Macro Flow Control    \  If-Else  \  If Directory

Syntax:

<if_dir>("Directory", "Condition", "Reserved")

Directory

Full path to the directory to check against the Condition.

Condition

Condition can be one from  the following:
"EXIST" - the <if_dir> statement is true if the directory exist.
"NOTEXIST" - the <if_dir> statement is true if the directory does not exist.

Reserved

Must be empty string.

Example:

<#> This macro shows how to use if-dir condition

<#>

<commands_only_on>

<if_dir>("c:\windows","EXIST","")

   <msg>(100,100,"'c:\windows' exist.","Message",1)

<else>

   <msg>(100,100,"'c:\windows' NOT exist.","Message",1)

<endif>


<if_clp>
<if_clp> Clipboard-related condition.

Command Tree:

Macro Flow Control    \  If-Else  \  If Clipboard

Syntax:

<if_clp>("Condition", "Reserved")

Condition

Condition can be one from  the following:
"EMPTY" - the <if_clp> statement is true if the clipboard is empty.
"SET" - the <if_clp> statement is true if the clipboard contains some data.

Reserved

Must be empty string.

Example:

<#> This macro shows how to use if-clp condition

<#>

<commands_only_on>

<if_clp>("EMPTY","")

   <msg>(100,100,"Clipboard is empty.","Message",1)

<else>

   <varset>("vEmpty=YES/NO","Clipboard is not empty. Do you want to empty it ?")

   <if_str>("vEmpty==YES")

      <clpempty>

   <endif>

<endif>


<goto>
<goto> Jump to other point (defined by <label>) in the macro and continue macro execution from this point.

Command Tree:

Macro Flow Control    \  Go to  \  Go to

Syntax:

<goto>("Label")

Label

Name of the point to jump to.  For example, <goto>("Section1") jumps to the point <label>("Section1") in the same macro.

Example:

<#> This macro shows how to use 'goto' and 'label' commands

<#>

<commands_only_on>

<begloop>(0)

<if_num>("_vLoopCounter>5")

   <msg>(100,100,"Too many loops...","Message",1)

   <goto>("END")

<endif>

<endloop>

<msg>(100,100,"OK","Message",1)

<label>("END")


<label>
<label> Specifies the point in the macro where you can jump using <goto> command.

Command Tree:

Macro Flow Control    \  Go to  \  Label

Syntax:

<label>("Label")

Label

Name of the point to jump to.  For example, <goto>("Section1") jumps to the point <label>("Section1") in the same macro.

Example:

<#> This macro shows how to use 'goto' and 'label' commands

<#>

<commands_only_on>

<begloop>(0)

<if_num>("_vLoopCounter>5")

   <msg>(100,100,"Too many loops...","Message",1)

   <goto>("END")

<endif>

<endloop>

<msg>(100,100,"OK","Message",1)

<label>("END")


<begloop>
<begloop> Begins loop.  The loop allows to repeat some part of macro many times.  Each <begllop> commands must be followed by <endloop>.

Command Tree:

Macro Flow Control    \  Loop  \  Begin Loop

Syntax:

<begloop>(Repeat)

Repeat

The number of repeats.  Can be one of these options:
Repeat > 0  -  The Repeat is the actual number of loops to be performed.
Repeat = 0  -  The user specifies the number of repeats in the runtime.
Repeat = -1  -  The user is asked each loop to continue or stop repeating.

Example:

<#> This macro shows how to use loops

<#>

<commands_only_on>

<varset>("vNum=","How many Notepads you want to open ?")

<begloop>(vNum)

   <execappex>("notepad.exe","","",0,0)

<endloop>


<pause>
<pause> Stops (pauses) macro execution until user presses 'Enter' key.

Command Tree:

Macro Flow Control    \  Wait   \  Pause For Input

Syntax:

<pause>

Example:

<#> This macro shows how to use 'pause' command

<#>

<commands_only_on>

<msg>(100,100,"Start Notepad and press 'Enter' key.","Message",0)

<pause>

<msgoff>

<actwin>("notepad",0,0,"no")

<commands_only_off>Dear Mr. <msg>(100,100,"Insert the customer name and press 'Enter' key.","Message",0)<pause><msgoff>,

we are writing you this letter because...


<wx>
<wx> Wait for X milliseconds.  The behavior of this command depends on the macro playback speed that can user specify for each macro in the "Item Properties" dialog box.

Command Tree:

Macro Flow Control    \  Wait   \  Wait X milisec

Syntax:

<wx>(Time)

Time

Time to wait in milliseconds.

Example:

<#> This macro shows how to use 'wx' command

<#>

<commands_only_on>

<varset>("vTime=","How many seconds to wait ?")

<varchng>("vTime","*","1000")

<wx>(vTime)

<msg>(100,100,"Specified time is out.","Message",1)


<waitfor>
<waitfor> Wait for a special event (window, clipboard, key, mouse) to occur.

Command Tree:

Macro Flow Control    \  Wait   \  Wait X milisec

Syntax:

<waitfor>("Object", "Event", "Param",  TimeOut, Exact)

Object

Can be one of these:
"WIN" - a window related event is expected
"CLIP" - a clipboard related event is expected
"KEY" - a specific key press is expected
"MOUSE"  - a mouse click is expected

Event

These events are supported for particular Object:
"WIN" :
   - "OPEN" - wait until the window specified by Param is opened.
   - "CLOSE" - wait until the window specified by Param is closed.
   - "ACT" - wait until the window specified by Param is activated.
   - "NOACT" - wait until the window specified by Param is deactivated.
"CLIP" :
   - "EMPTY" - wait until the clipboard is emptied.
   - "SET" - wait until some data are put into the clipboard.
"KEY" :
   - "" (key is pressed) - wait until some of the keys specified by  Param is pressed.
"MOUSE" :
   - "" (mouse click) - wait until mouse click specified by  Param appears.

Param

Has this meaning depending on the Object:
"WIN" - window title
"CLIP" - not used
"KEY" - can be one or more keys.  For example, if Param is "abc<F6><alt>" the <waitfor> waits until either a or b or c or F6 or Alt key is pressed.
"MOUSE" - can be one of these:
   <mlbu> - left mouse button
   <mmbu> - middle mouse button
   <mrbu> - right mouse button

TimeOut

Timeout in seconds.  If 0, the <waitfor> never timeouts.

Exact

Used only for "WIN" Object.  If 1, the window title must exactly match the Param.  If 0,  the Param can be a substring of a window title.

Example:

<#> This macro shows how to use 'waitfor' command

<#>

<commands_only_on>

<msg>(100,100,"Press 'Ctrl' key to continue this macro.","Message",0)

<waitfor>("KEY","","<ctrl>",5,0)

<msgoff>

<msg>(100,100,"Press left mouse button to continue this macro.","Message",0)

<waitfor>("MOUSE","","<mlbu>",5,0)

<msgoff>

<msg>(100,100,"Macro is finished.","Message",1)


<faston>
<faston> Specifies that all the keystrokes are send as fast as possible to the destination application.  In some cases, the application receiving the keystrokes is not able to respond to all of them in time and some maybe lost (it  means that the macro is not functioning properly).

Command Tree:

Macro Flow Control    \  Send Keystrokes Fast  \  ON

Syntax:

<faston>

Example:

<#> This macro shows how to use 'faston' command

<#>

<execappex>("notepad.exe","","",0,0)<fastoff>This text is being inserted slower...

<faston>...and this text is being inserted faster.


<commands_only_on>
<commands_only_on> This command changes the macro interpretation.   The part of the macro that follows <commands_only_on> is interpreted so that only commands are executed and all the other text (keys) is ignored.  This allows to nicely format macro consisting only  from commands.  The <commands_only_off> causes that also all the text (keys) is interpreted usual way.

Command Tree:

Macro Flow Control    \  Commands Only  \  ON

Syntax:

<commands_only_on>

Example:

<#> This macro shows how to use 'commands_only_on'

<#>

<commands_only_on>

<label>("lbl_Again")

<msg>(100,100,"Starting Notepad ...","Message",0)

<execappex>("notepad.exe","","",0,0)

<msgoff>

<commands_only_off>Hello,

this macro just demonstrates 'commands_only_on/off' commands.

<commands_only_on>

<varset>("vAgain=YES/NO","Do you want to run this macro again ?")

<if_str>("vAgain==YES")

   <goto>("lbl_Again")

<endif>


<text>
<text> Formats text saved in a variable.

Command Tree:

Text Format

Syntax:

<text>("Variable", "Operation", "Operand1", "Operand2")

Variable

Variable that contains the text to be formatted.  The formatted text is saved back in the variable.

Operation

Operation can be one from  the following:
"APPEND" - appends a text specified by Operand1 to the end of the text in the Variable.
"LEFT" - extracts first Operand1 characters from the Variable text.
"RIGHT" - extracts last  Operand1 characters from the Variable text.
"UPPERCASE" - changes the Variable text to uppercase.
"LOWERCASE" - changes the Variable text to lowercase.
"JUSTIFY" - multiline text operation.  Formats Variable text so that all the lines have the same length (defined by Operand1).
"INDENT_LEFT" - multiline text operation.  Removes one space character from begin of each line.
"INDENT_RIGHT" - multiline text operation.  Adds one space character to  begin of each line.
"LIST" - multiline text operation.  Creates numbered list from the paragraphs delimited by an empty line.
"CENTER" - multiline text operation.  Formats Variable text so that all the lines are centered and have the same length (defined by Operand1).
"UNDERLINE" - To the Variable text, adds new line consisting from a character defined by Operand1.
"INTERSPACES" - Inserts spaces after each character ("text" becomes "t e x t").
"ALIGN_LEFT" - multiline text operation.  Formats Variable text so that all the spaces on the begin of each line are removed (defined by Operand1).
"ALIGN_RIGHT" - multiline text operation.  Formats Variable text so that all the lines have the same length (defined by Operand1) and all the lines are right aligned.
"REPLACE" - replaces substring defined by Operand1 by Operand2 string.
"FIND" - finds substring defined by Operand1 and saves its index (zero based) to the Variable.
"INSERT" - inserts string defined by Operand1 to the position defined by Operand2.
"DELETE" - deletes Operand2 characters starting from Operand1 position.
"GET_CHAR" - the character from the Operand1 position is saved in Operand2 variable.
"TOGGLE_CASE" - uppercase characters are changed to lowercase and vice versa.
"SENTENCE_CASE" - the first character in the sentence is changed to uppercase.
"FIRST_UPPER" - the first character of each word is changed to uppercase.

Operand1

depends on the Operation and has this meaning:
"APPEND" - text to append.
"LEFT" - number of characters to extract.
"RIGHT" - number of characters to extract.
"UPPERCASE" - not used.
"LOWERCASE" - not used.
"JUSTIFY" - the length of text rows.  If zero, the length of the first row  is taken.
"INDENT_LEFT" - not used.
"INDENT_RIGHT" - not used.
"LIST" - the length of text rows.  If zero, the length of the first row  is taken.
"CENTER" - the length of text rows.  If zero, the length of the first row  is taken.
"UNDERLINE" - the character to be used to 'underline' the text.
"INTERSPACES" - not used.
"ALIGN_LEFT" - not used
"ALIGN_RIGHT" - the length of text rows.  If zero, the length of the first row  is taken.
"REPLACE" - the string to be replaced.
"FIND" - the string to find .
"INSERT" - the position where to insert string.
"DELETE" - the position where to delete characters.
"GET_CHAR" - the position of the character to get
"TOGGLE_CASE" - not used.
"SENTENCE_CASE" - not used.
"FIRST_UPPER" -  not used.

Operand2

depends on the Operation and has this meaning:
"APPEND" - not used.
"LEFT" - not used.
"RIGHT" - not used.
"UPPERCASE" - not used.
"LOWERCASE" - not used.
"JUSTIFY" - not used.
"INDENT_LEFT" - not used.
"INDENT_RIGHT" - not used.
"LIST" - the format of the list.  Can be one of these string:
   "1)"
   "1."
   "1/"
   "A)"
   "A."
   "A/"
   "a)"
   "a."
   "a/"
   "-"
   "#"
   "*"
"CENTER" - not used.
"UNDERLINE" - not used.
"INTERSPACES" - not used.
"ALIGN_LEFT" - not used
"ALIGN_RIGHT" - not used.
"REPLACE" - the replacing string.
"FIND" - not used.
"INSERT" - the string to insert.
"DELETE" - the number of characters to delete.
"GET_CHAR" - the variable receiving the character.
"TOGGLE_CASE" - not used.
"SENTENCE_CASE" - not used.
"FIRST_UPPER" -  not used.

Example:

<#> This macro shows how to use text formatting command

<#>

<commands_only_on>

<msg>(100,100,"Copy a text to format to the clipboard and press OK.","Message",1)

<if_clp>("SET","")

   <varchng>("vText","GC","")

   <varset>("vOperation=Justify|Center|Indent Right|List","Select operation")

   <if_str>("vOperation==Justify")

      <text>("vText","JUSTIFY","0","")

   <endif>

   <if_str>("vOperation==Center")

      <text>("vText","CENTER","0","")

   <endif>

   <if_str>("vOperation==Indent Right")

      <text>("vText","INDENT_RIGHT","0","")

   <endif>

   <if_str>("vOperation==List")

      <text>("vText","LIST","0","1.")

   <endif>

   <clpput>("vText")

   <msg>(100,100,"The formatted text is in the clipboard.","Message",1)

<else>

   <msg>(100,100,"Clipboard is empty.","Message",1)

<endif>


<form_item>
<form_item> Defines a form item.

Command Tree:

Form  \  Form Item

Syntax:

<form_item>("FormID", "ItemLabel", "ItemType", "ItemDefValue", "ItemVariable")

FormID

A text identifier of the form (for example, "FM1").  All the items of the same form must have the same identifier.

ItemLabel

The label that appears above the control in the form window.

ItemType

Item type.  Can be one of these:
"LIST" - list (combo) box selection
"EDIT" - edit control (single line)
"CHECK" - check box button
"LINE" - static line
"TEXT" - static text

ItemDefValue

Defines default value (the value that initially appears in the form window).

ItemfVariable

Variable that receives the data (value) the user inserts.

Example:

<#> This example shows how to use form commands

<#>

<commands_only_on>

<form_item>("FM1","This is a simple calculator for: + - * /","TEXT","0","")

<form_item>("FM1","","LINE","0","")

<form_item>("FM1","Operand 1:","EDIT","0","vOper1")

<form_item>("FM1","Operation:","LIST","Plus|Minus|Multiply|Divide","vOperation")

<form_item>("FM1","Operand 2:","EDIT","0","vOper2")

<form_item>("FM1","","LINE","0","")

<form_item>("FM1","Continue ?","CHECK","0","vAgain")

<label>("lbl_Again")

<form_show>("FM1","Simple Calculator","calc.exe",0)

<if_str>("vOperation==Plus")

   <varchng>("vOper1","+","vOper2")

<endif>

<if_str>("vOperation==Minus")

   <varchng>("vOper1","-","vOper2")

<endif>

<if_str>("vOperation==Multiply")

   <varchng>("vOper1","*","vOper2")

<endif>

<if_str>("vOperation==Divide")

   <varchng>("vOper1","/","vOper2")

<endif>

<msg>(100,100,"vOper1","The result is:",1)

<if_str>("vAgain==YES")

   <goto>("lbl_Again")

<endif>


<form_show>
<form_show> Shows the form defined by <form_item> commands.

Command Tree:

Form  \  Form Show

Syntax:

<text>("FormID", "WinTitle", "IconFile", "IconInx")

FormID

A text identifier of the form (for example, "FM1").  All the items of the same form must have the same identifier.

WinTitle

The title of the form window.

IconFile

The full path to the file with desired icon.

IconInx

Index of the icon within the IconFile.

Example:

<#> This example shows how to use form commands

<#>

<commands_only_on>

<form_item>("FM1","This is a simple calculator for: + - * /","TEXT","0","")

<form_item>("FM1","","LINE","0","")

<form_item>("FM1","Operand 1:","EDIT","0","vOper1")

<form_item>("FM1","Operation:","LIST","Plus|Minus|Multiply|Divide","vOperation")

<form_item>("FM1","Operand 2:","EDIT","0","vOper2")

<form_item>("FM1","","LINE","0","")

<form_item>("FM1","Continue ?","CHECK","0","vAgain")

<label>("lbl_Again")

<form_show>("FM1","Simple Calculator","calc.exe",0)

<if_str>("vOperation==Plus")

   <varchng>("vOper1","+","vOper2")

<endif>

<if_str>("vOperation==Minus")

   <varchng>("vOper1","-","vOper2")

<endif>

<if_str>("vOperation==Multiply")

   <varchng>("vOper1","*","vOper2")

<endif>

<if_str>("vOperation==Divide")

   <varchng>("vOper1","/","vOper2")

<endif>

<msg>(100,100,"vOper1","The result is:",1)

<if_str>("vAgain==YES")

   <goto>("lbl_Again")

<endif>


Samples
The examples provided here can be inserted in newly created macros using copy/paste.  The examples are in "italic" and whole the example should be copied as it is.  In most of cases, the examples do not rely on other existing macros and can be immediately executed without additional changes or workarounds.  In some cases the examples create files or directories (for example, when demonstrating commands like "create file", etc.) and it is up to the user to delete them.


Commands Syntax

General commands syntax is as follows:
   <command>(param1, param2,..., paramN)

Parameter can be:

4.	Static text (constant number).

5.	Variable

6.	Combination of a static text and variables.  Variable used in a combination with static text must be enclosed in % chars (“a text %vVariable% text continues…).  For example, to create a file with name based on the current date you can use this: <filecreate>(“c:\myfiles\%_vCurrDate_Year%-%_vCurrDate_MM%-%_vCurrDate_DD%.doc”,0).  This will create c:\myfiles\2000-08-19.doc file.

Some parameters are enclosed in quotation " marks but this differs for each command.   It is not necessary to know syntax of each command because each command can be visually edited.
If the syntax is wrong the command is usually not recognized (or a parameter is not recognized) and is not functioning properly.


Commands Tree

Commands tree shows all the commands available.  The commands tree window shows automatically when "Macro" tab is selected in the "Item Properties" dialog box.  Use "Add"/"Insert" button to add/insert desired command to the macro.


<netcondrive>
<netcondrive> Maps a network directory to local drive.

Command Tree:

Networking /Connect Network Drive

Syntax:

<netcondrive>("Drive", "Net Directory", "User Name", "User Password", Restore)

Drive

Drive you want to map the network directory map to (e.g., "X:").  Keep in mind it must be one letter followed by : .

Net Directory

Network directory (for example, "\\server\mydir").

User Name

User name user uses to log on to the machine where the net directory resides.

User Password

Password user uses to log on to the machine where the net directory resides.

Restore

Restore at next logon: If 1 the drive will be automatically mapped at next logon.

Example:

<#> This macro maps a network directory to local drive.

<#>

<netcondrive>("X:","\\server\mzdir","john","jpwd",0)


<netdiscondrive>
<netdiscondrive> Disconnects local drive from a network directory.

Command Tree:

Networking /Disconnect Network Drive

Syntax:

<netcondrive>("Drive", Restore)

Drive

Drive you want to map the network directory map to (e.g., "X:").  Keep in mind it must be one letter followed by : .

Restore

Restore at next logon: If 1 the drive will be automatically mapped at next logon.

Example:

<#> This macro disconnects drive from a network directory.

<#>

<netdiscondrive>("X:", 0)


Scripts

Note:  Available only in “ToolsWorks Advanced Scripting” and “ToolsWorks Admin & Developer”.

There are these script languages supported: Basic Script, VB Script and Java Script.  Basic Script is Visual Basic for Application™ compatible language build on top of popular SAX Basic engine.  There is full support for Basic Script - IDE, debugger, tool tips, dialog editor, language reference help, etc.  Ss for the VB Script and Java Script, the level of support is limited to execution (there is not a debugger or editor for VB Script and Java Script).

Script can be either “embedded” or “external”.  Embedded script is an integral part of the macro while external script is saved in other file.

Embedded:

Basic Script
<script_basic>   </script_basic>

VB Script:
<script_vbs>   </script_vbs>

JavaScript
<script_js>   </script_js>

External:

<script_file>

Note: Visual Basic for Application is trademark of Microsoft Corporation.


<script_basic>
<script_basic>   </script_basic> Encloses “Basic Script” script within a macro.

Command Tree:

Script  \ Embedded Scripts \ Basic Script

Syntax:

<script_basic>A script source code goes here…</script_basic>

Example:

<#> Count sin(1), put it to clipboard and show it in Notepad

<#>

<commands_only_on>

<script_basic>

Sub Main

   s = Sin(1)

   Clipboard s

End Sub

</script_basic>

<execappex>("notepad.exe","","",0,0)<ctrl>v<ctrl>


<script_vbs>
<script_vbs>   </script_vbs> Encloses “VBScript” script within a macro.

Command Tree:

Script  \ Embedded Scripts \ VB Script

Syntax:

<script_vbs>A script source code goes here…</script_vbs>

Note:  You have to have installed “VB Script” scripting host to be able to run JavaScript scripts.  The scripting host is automatically installed with MSIE 4.0 or later.

Example:

<#> Very simple VB Script example

<script_vbs>

MsgBox("This is VB Script")

</script_vbs>


<script_js>
<script_js>   </script_js> Encloses “JavaScript” script within a macro.

Command Tree:

Script  \ Embedded Scripts \ Java Script

Syntax:

<script_js>A script source code goes here…</script_js>

Note:  You have to have installed JavaScripts scripting host to be able to run JavaScript scripts.  The scripting host is automatically installed with MSIE 4.0 or later.

Example:

<#> This is very simple JavaScript example

<script_js>

function Hello()

{

    var WSHShell = WScript.CreateObject("WScript.Shell");

    WSHShell.Popup("Hello, this is JavaScript");

}

Hello()

</script_js>


<script_file>
<script_file>  Executes a script saved in an external file.

Command Tree:

Script  \ External Script File

Syntax:

<script_file>(“Script file name”, Wait for script to finish)

Script file name:

Script file to run.  There are these file types supported:

.bss – Basic Script file

.bsx – encoded Basic Script file

.vbs – VB Script file

.js  - Java Script file

The file should be either full path (e.g.,  "c:\myscripts\script1.bss") or just file name (e.g., "script.bss").  Partial or relative paths (e.g., "..\scripts\script.bss") are not supported at this time. All the scripts that you call using just the name (e.g., "script.bss") must be saved in the "scripts" directory.  In the “Basic Script” scripts, it is possible to use '#Uses "some-file" directives that allows to use symbols defined in other modules.  In the "uses" directives, both BSS and BSX files can be used (they also have to be in "scripts" directory or full path must be supplied).

Wait for script to finish:

If equal to 1, the macro waits until script execution is finished.

If equal to 0, the macro continues execution without waiting for script to finish.

Example:

<#> Minimize all windows and then run

<#> script from a file

<#>

<winminall><script_file>("c:\program files\ToolsWorks AS\scripts\script1.bss",0)